#include<bits/stdc++.h>
using namespace std;

int a[111]; 

bool isPrime(int x)
{
	if(x < 2)
		return false;
	int k = sqrt(x);
	for(int i = 2;i <= k;i++)
		if(x%i == 0)
			return false;
	return true;
}

int main()
{
	int n;
	cin>>n;
	int cnt = 0;
	for(int i = 1;i <= n;i++)
	{
		cin>>a[i];
		if(isPrime(a[i]))
			cnt++;
	}
	auto idx = max_element(a+1, a+n+1);
	cout<<*idx<<" "<<idx-a-1<<" "<<cnt;
	return 0;
}

